//package com.yv.security.core.social.qq;
//
//import javax.sql.DataSource;
//
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.context.annotation.Configuration;
//import org.springframework.core.env.Environment;
//import org.springframework.security.crypto.encrypt.Encryptors;
//import org.springframework.social.UserIdSource;
//import org.springframework.social.config.annotation.ConnectionFactoryConfigurer;
//import org.springframework.social.config.annotation.EnableSocial;
//import org.springframework.social.config.annotation.SocialConfigurer;
//import org.springframework.social.connect.ConnectionFactoryLocator;
//import org.springframework.social.connect.UsersConnectionRepository;
//import org.springframework.social.connect.jdbc.JdbcUsersConnectionRepository;
///**
// * Configurer JdbcUserConnectionRepository.
// * In the tutor video it was SocialConfigurerAdapter that was implemented (release 1.1.4), perhaps it's not available in the 1.1.6 release version.
// * @author Administrator
// *
// */
//@EnableSocial
//@Configuration
//public class SocialConfig implements SocialConfigurer {
//
//	@Autowired
//	private DataSource dataSource;
//	
//	@Override
//	public void addConnectionFactories(ConnectionFactoryConfigurer connectionFactoryConfigurer,
//			Environment environment) {
//		// TODO Auto-generated method stub
//		
//	}
//
//	@Override
//	public UserIdSource getUserIdSource() {
//		// TODO Auto-generated method stub
//		return null;
//	}
//	
//	@Override
//	public UsersConnectionRepository getUsersConnectionRepository(ConnectionFactoryLocator connectionFactoryLocator) {
//		// The third param helps to encrypt user data before inserting into database.
//		// noOpText indicates no encryption will be used.
//		JdbcUsersConnectionRepository repository = new JdbcUsersConnectionRepository(dataSource, connectionFactoryLocator, Encryptors.noOpText());
//		// If the default talbe name "UserConnection" has prefix when created, then you need to setTablePrefix here.
//		// repository.setTablePrefix("yv_");
//		return repository;
//	}
//
//
//
//}
